Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plate cache updates and DB serialization clean up. #5162

Merged
merged 4 commits into from
Jan 30, 2024

Conversation

labkey-klum
Copy link
Contributor

Rationale

Removes support for plate name in the cache. Plate by name is deprecated and could eventually be removed. Instead the more recent plateId has been added to the cache.

This PR also introduces a PlateBean to help with serialization to and from the database. This allows us to be a bit cleaner with the Plate instance which is a richer, composed object so we don't have to have methods like:

  • getPlateType & getPlateTypeObject
  • getPlateSet & getPlateSetObject

Which were needed to support DB binding plus returning the underlying object instances.

@@ -205,7 +205,7 @@ private static Plate getPlate(ExpProtocol protocol)
{
// resolve plate by the legacy deprecated plate name method
ObjectProperty prop = protocol.getObjectProperties().get(protocol.getLSID() + AbstractPlateBasedAssayProvider.PLATE_TEMPLATE_SUFFIX);
return prop != null ? PlateManager.get().getPlate(protocol.getContainer(), prop.getStringValue()) : null;
return prop != null ? PlateManager.get().getPlateByName(protocol.getContainer(), prop.getStringValue()) : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, did you verify these changes through the upgrade(s)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I ran the upgrade manually, but you have to revert the protocol property to use the plate name unless you upgrade from an older version. Did you see an error on your end?

/**
* Serializes a row in the assay.plate table.
*/
public class PlateBean extends Entity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Splitting these up will serve us well I believe and leave us less prone to improper serialization on either side.

@labkey-klum labkey-klum self-assigned this Jan 29, 2024
@labkey-klum labkey-klum merged commit 73bd8db into develop Jan 30, 2024
2 checks passed
@labkey-klum labkey-klum deleted the fb_plate_cache_refactor branch January 30, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants